import window from '@ohos.window';
import utils from '../common/core/utils';
import UIAbility from '@ohos.app.ability.UIAbility';

export default class EntryDetailAbility extends UIAbility {
  onCreate(want) {
    let aid = want?.parameters?.remoteData?.aid;
    if (utils.isEmpty(aid))
      aid = want?.parameters?.aid;
    globalThis.aid = aid?.toString();
    let aids = want?.parameters?.remoteData?.aids;
    globalThis.aids = aids?.toString().split(',');
  }

  onWindowStageCreate(windowStage: window.WindowStage) {
    utils.setLayoutFullScreen(windowStage, utils.COLOR_WHITE, utils.COLOR_BLACK, utils.COLOR_LIKE_WHITE, utils.COLOR_BLACK);
    if (!utils.isEmpty(globalThis.aid))
      windowStage.loadContent('pages/Detail');
    else
      windowStage.loadContent('pages/Receive');
  }
}